<?php

namespace app\demo\controller;

use app\BaseController;
use app\model\Demo;
use think\facade\Db;

class Data extends BaseController
{
    public function index()
    {
        $res = Db::table('mall_goods')->where('id', '=', '88')->select();
        dump($res);
    }

    public function test()
    {
        $modeOj = new demo();
        $results = $modeOj->where('goods_specs_type', '=', '1')
            ->limit(2)
            ->order('stock', 'desc')
            ->select();
        foreach ($results as $result) {
            dump($result['sub_title']);
            dump($result->status_text);
        }
    }
}